package com.siyu.tickets.entity.base;

import java.io.Serializable;

import com.siyu.tickets.entity.AdminUser;
import com.siyu.tickets.entity.Partner;
import com.siyu.tickets.entity.Supplier;

/**
 * This is an object that contains data related to the jo_user table. Do not
 * modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * 
 * @hibernate.class table="jo_user"
 */

public abstract class BaseSysUser implements Serializable {

	private static final long serialVersionUID = 1L;

	public static String REF = "SysUser";
	public static String PROP_CREATE_TIME = "createTime";
	public static String PROP_USERNAME = "username";
	public static String PROP_PASSWORD = "password";
	public static String PROP_EMAIL = "email";
	public static String PROP_LAST_LOGIN_TIME = "lastLoginTime";
	public static String PROP_LAST_LOGIN_IP = "lastLoginIp";
	public static String PROP_ID = "id";

	// constructors
	public BaseSysUser() {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseSysUser(java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseSysUser(java.lang.Integer id, java.lang.String username, java.lang.String password,
			java.util.Date createTime) {
		this.setId(id);
		this.setUsername(username);
		this.setPassword(password);
		this.setCreateTime(createTime);
		this.setLoginCount(loginCount);
		initialize();
	}

	protected void initialize() {
	}

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String username;
	private java.lang.String password;
	private java.lang.String realname;
	private java.lang.String email;
	private java.util.Date createTime;
	private java.util.Date lastLoginTime;
	private java.lang.String lastLoginIp;
	private java.lang.Integer loginCount;

	private java.lang.Boolean activation;
	private java.lang.String activationCode;

	private java.lang.Boolean enable;

	// one to one
	private AdminUser admin;
	private Supplier supplier;
	private Partner partner;

	/**
	 * Return the unique identifier of this class
	 * 
	 */
	public java.lang.Integer getId() {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * 
	 * @param id
	 *            the new ID
	 */
	public void setId(java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
	 * Return the value associated with the column: username
	 */
	public java.lang.String getUsername() {
		return username;
	}

	/**
	 * Set the value related to the column: username
	 * 
	 * @param username
	 *            the username value
	 */
	public void setUsername(java.lang.String username) {
		this.username = username;
	}

	public java.lang.String getRealname() {
		return realname;
	}

	public void setRealname(java.lang.String realname) {
		this.realname = realname;
	}

	/**
	 * Return the value associated with the column: email
	 */
	public java.lang.String getEmail() {
		return email;
	}

	/**
	 * Set the value related to the column: email
	 * 
	 * @param email
	 *            the email value
	 */
	public void setEmail(java.lang.String email) {
		this.email = email;
	}

	/**
	 * Return the value associated with the column: password
	 */
	public java.lang.String getPassword() {
		return password;
	}

	/**
	 * Set the value related to the column: password
	 * 
	 * @param password
	 *            the password value
	 */
	public void setPassword(java.lang.String password) {
		this.password = password;
	}

	/**
	 * Return the value associated with the column: create_time
	 */
	public java.util.Date getCreateTime() {
		return createTime;
	}

	/**
	 * Set the value related to the column: create_time
	 * 
	 * @param createTime
	 *            the create_time value
	 */
	public void setCreateTime(java.util.Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * Return the value associated with the column: last_login_time
	 */
	public java.util.Date getLastLoginTime() {
		return lastLoginTime;
	}

	/**
	 * Set the value related to the column: last_login_time
	 * 
	 * @param lastLoginTime
	 *            the last_login_time value
	 */
	public void setLastLoginTime(java.util.Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	/**
	 * Return the value associated with the column: last_login_ip
	 */
	public java.lang.String getLastLoginIp() {
		return lastLoginIp;
	}

	/**
	 * Set the value related to the column: last_login_ip
	 * 
	 * @param lastLoginIp
	 *            the last_login_ip value
	 */
	public void setLastLoginIp(java.lang.String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}

	/**
	 * Return the value associated with the column: login_count
	 */
	public java.lang.Integer getLoginCount() {
		return loginCount;
	}

	/**
	 * Set the value related to the column: login_count
	 * 
	 * @param loginCount
	 *            the login_count value
	 */
	public void setLoginCount(java.lang.Integer loginCount) {
		this.loginCount = loginCount;
	}

	public java.lang.Boolean getActivation() {
		return activation;
	}

	public void setActivation(java.lang.Boolean activation) {
		this.activation = activation;
	}

	public java.lang.String getActivationCode() {
		return activationCode;
	}

	public void setActivationCode(java.lang.String activationCode) {
		this.activationCode = activationCode;
	}

	public java.lang.Boolean getEnable() {
		return enable;
	}

	public void setEnable(java.lang.Boolean enable) {
		this.enable = enable;
	}

	public AdminUser getAdmin() {
		return admin;
	}

	public void setAdmin(AdminUser admin) {
		this.admin = admin;
	}

	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	public Partner getPartner() {
		return partner;
	}

	public void setPartner(Partner partner) {
		this.partner = partner;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof com.siyu.tickets.entity.SysUser))
			return false;
		else {
			com.siyu.tickets.entity.SysUser sysUser = (com.siyu.tickets.entity.SysUser) obj;
			if (null == this.getId() || null == sysUser.getId())
				return false;
			else
				return (this.getId().equals(sysUser.getId()));
		}
	}

	public int hashCode() {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId())
				return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

	public String toString() {
		return super.toString();
	}

}